export function changeBasemap(map) {
  return new Promise((resolve, reject) => {
    if (!map) { resolve(false) }
    let imagery = earth.layersManager.getImageryProvider(map);
    imagery && imagery.readyPromise.then(ret => {
      if (ret) {
        viewer.imageryLayers.remove(viewer.imageryLayers.get(0));
        viewer.imageryLayers.addImageryProvider(imagery, 0);
        resolve(true);
      }
    })
  })
}